﻿using Avalon.Core.Data.Templates;
using System;

namespace Avalon.Core.MVC
{
    public class AvalonRenderer : Avalon.Core.MVC.IViewRenderer
    {
        public IViewRenderHelper ViewRenderHelper { get; set; }
        public string ActionName { get; set; }
        public string FormatName { get; set; }

        public AvalonRenderer() { }
        public AvalonRenderer(AvalonViewRenderer viewRenderer)
        {
            ViewRenderHelper = (IViewRenderHelper)Activator.CreateInstance(Type.GetType(viewRenderer.Renderer), null);
            FormatName = viewRenderer.Template;
            ActionName = viewRenderer.Action;
        }
    }
}
